package mest.service.cxj.impl;

import mest.Dto.cxj.WorkrouteWorkManytomanyDto;
import mest.dao.cxj.WorkrouteWorkManytomanyDao;
import mest.entity.workroutework_manytomany;
import mest.service.cxj.WorkrouteWorkManytomanyService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class WorkrouteWorkManytomanyServiceImpl implements WorkrouteWorkManytomanyService {

    @Resource
    private WorkrouteWorkManytomanyDao workrouteWorkManytomanyDao;

    @Override
    public boolean insertWorkRouteWork(List<workroutework_manytomany> workrouteWorkManytomany,String theirDb) {
        boolean flag = false;
        int num = workrouteWorkManytomanyDao.insertWorkRouteWork(workrouteWorkManytomany,theirDb);
        if (num > 0) {
            flag = true;
        }
        return flag;
    }

    @Override
    public List<WorkrouteWorkManytomanyDto> selectWorkRouteAndWorkById(Integer wrid,String workName,String theirDb) {
        return workrouteWorkManytomanyDao.selectWorkRouteAndWorkById(wrid,workName,theirDb);
    }
}
